package com.kailong.servlet.student;

import com.kailong.dao.admin.ManageSeatDao;
import com.kailong.pojo.Seat;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

@WebServlet("/student/studentSeatReserve")
public class StudentSeatReserve extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        resp.setContentType("text/html;charset=utf-8");

        String tno = req.getParameter("tno");
        Seat seat = ManageSeatDao.selectByTno(tno);
        HttpSession session = req.getSession();
        req.setAttribute("tno",seat.getTno());
        req.setAttribute("tsquare",seat.getTsquare());
        req.setAttribute("tfloor",seat.getTfloor());
        req.setAttribute("cpage",req.getParameter("cpage"));
        req.getRequestDispatcher("studentSeatReserve.jsp").forward(req,resp);

    }
}
